package com.controller;

import com.service.IDepService;
import com.vo.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
@CrossOrigin("*")
public class DepController {

    @Autowired
    private IDepService depService;


    @RequestMapping("/showDep")
    public String showDep(Model m){
        List list=depService.findAll();
        m.addAttribute("list",list);
        m.addAttribute("age",20);
        return "showDep.html";
    }



}
